#ifndef THREADABLE_H_INCLUDED
#define THREADABLE_H_INCLUDED
#include <boost/thread.hpp>
#include <string>
class ThreadMgr;

class Threadable{
public:
    Threadable();

    virtual ~Threadable();

    //initialize n mutexes
    void mutex_init(int n);


    //lock mutex[index]
    inline void lock(int index)
    {
        m_mutexArrPtr[index].lock();
    }

    //unlock mutex[index]
    inline void unlock(int index)
    {
        m_mutexArrPtr[index].unlock();
    }

    virtual void svc() = 0;





     int t_id;


    void activate();


protected:
    ThreadMgr * mgr;

    boost::mutex * m_mutexArrPtr;





};

#endif // THREADABLE_H_INCLUDED
